<template>
    <div class="nav">
      <van-sticky>
        <van-nav-bar
          :title="title"
          :left-arrow="leftArrow"
          :left-text="leftText"
          @click-left="onClickLeft"
        >
        </van-nav-bar>
      </van-sticky>
    </div>
</template>

<script>
export default {
  name: 'NavBar',
  props: {
    title: {
      type: String,
      default: ''
    },
    leftText: {
      type: String,
      default: ''
    },
    leftArrow: {
      type: Boolean,
      default: false
    },
    isGo: {
      type: Boolean,
      default: true
    }
  },
  methods: {
    onClickLeft () {
      if (!this.leftSolt) {
        if (this.isGo) {
          this.$router.go(-1)
        } else {
          this.$router.push({
            path: '/home'
          })
        }
      }
    },
    onClickRight () {
      console.log(111)
    }
  }
}

</script>
<style scoped lang="scss">
/deep/.van-nav-bar__content {
  background-color: #0bbef5 !important;
}
/deep/.van-nav-bar__title {
  font-size: 18px;
  color: #fff !important;
}
/deep/.van-nav-bar .van-icon {
    color: #fff !important;
}

</style>
